#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int N = 25;
int n, m;
char c;

int main()
{
    cin >> m >> c;
    n = m / 2 + m % 2;
    n = n - 2;
    for(int i = 0; i < m; i ++)
    {
        cout << c;
    }
    cout << endl;
    while(n --)
    {
        for(int i = 0; i < m; i ++)
        {
            if(i == 0 || i == m - 1)
            {
                cout << c;
            }else {
                cout << " ";
            }
        }
        cout << endl;
    }
    for(int i = 0; i < m; i ++)
    {
        cout << c;
    }
    cout << endl;

    return 0;
}